home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / SUPER_M2.ZIP;1 / SCIENCE.EXE / HELP8.PRN < prev    next >
Encoding:
Text File  |  1988-06-12  |  25.2 KB  |  509 lines

  1.  5. ROOT FINDING 
  2.  
  3.  
  4.  This feature of the program allows the user to solve non-linear 
  5.  equation like:
  6.  
  7.  @COS(X)-X=0  
  8.  
  9.  The program offers 3 types of solving methods
  10.  
  11.  1. Plot and search  - plot the function and find the points where the
  12.                        function actually cross the zero axis.
  13.  2. Under relaxation - A self converging method which converges to 
  14.                        the root of the function, the result depends on 
  15.                        the initial value which can be determined using 
  16.                        the Plot and search first.
  17.  3. Newton's         - Like Under relaxation but needs defining the
  18.                        derivative too, which is calculated analytically 
  19.                        by the user from the known function.
  20.  
  21.  
  22.  In this example we will show how we can solve the equation:
  23.  
  24.  @cos(X)-X=0
  25.  
  26.  for X.
  27.  
  28.  
  29.  5.1 <R>oot_find
  30.  
  31.  
  32.  Press <r> to get the next menu:
  33.                                                                                 
  34.  Plot_search  Under_relaxation  Newton's  View  Repeat  Edit                         
  35.  
  36.  
  37.  5.2 <P>lot_search
  38.  
  39.  
  40.  This feature allows the user to plot any analytic function and view 
  41.  where the function is equal to zero. By "zooming" the plot the user
  42.  can get closer and closer to the root of any equation. The equation 
  43.  should be arranged as F(x)=0 then by plotting F(x) as a function of x
  44.  we can view where the roots are located.
  45.  
  46.  Let's try to solve the equation    COS(X)-X=0
  47.  
  48.  Press <p> to get the next screen:                                                                                
  49.  ____________________________________________________________________________
  50.                                                                                
  51.              A           B           C           D           E  
  52.  1 ====================================================================    
  53.  2          Units        |     Output/Input      |        Memory      |    
  54.  3 ====================================================================    
  55.  4   None                |                  0.00 |                0.00|    
  56.  5 ====================================================================    
  57.           EV                                                                    
  58.  1   @COS(VAR)-VAR      
  59.  2       
  60.  3      
  61.  4       
  62.  5       
  63.  6       
  64.  7       
  65.  8   Input or edit the function as a FORMULA and press ENTER ....   
  66.  9       
  67.  10     
  68.  11    
  69.  12    
  70.  13     
  71.  14    
  72. ____________________________________________________________________________
  73.  
  74.  
  75.  The program is now in the Lotus EDIT mode so you can type the function
  76.  as a Lotus formula (no prefix) and press ENTER (press the ENTER key 
  77.  only to quit to the previous menu). Notice that we have used the 
  78.  variable "VAR" as the function variable, you can also use "R" as a 
  79.  variable ( @COS(R)-R ) but we recommend to use the variable "VAR" 
  80.  unless the function is too long to fit in 240 characters.
  81.  
  82.                                                      
  83.                             **** WARNING ****
  84.  
  85.  Since the program is now in the EDIT mode the Lotus keys are operative, 
  86.  however the user is strongly advised to use ONLY the UP, PGUP, DOWN 
  87.  and PGDN keys to scroll between the lines, the program doesn't allow 
  88.  scrolling to the sides by hiding all the columns except the current
  89.  column. Trying to unhide the columns MAY destroy the program code.
  90.  For example: if by mistake you have pressed the "/" key press ESC to 
  91.  get back to the READY mode and then press F2 to enter EDIT mode or 
  92.  just continue to type or press ENTER key to exit. 
  93.  
  94.  Type the formula [ @cos(var)-var ] and press ENTER to get the next 
  95.  three prompts:
  96.  
  97.  Input the lower limit - 0                                                        
  98.  
  99.  Input the upper limit - 7
  100.  
  101.  Input the number of steps - 100
  102.  
  103.  In each prompt type the number and press ENTER, if all three inputs 
  104.  are null (the ENTER key or the ESC were pressed three times, the 
  105.  program will quit to the previous menu) after the third prompt the 
  106.  next screen will shows up:
  107.  
  108. ____________________________________________________________________________
  109.  
  110.  Plot_search  Under_relaxation  Newton's  View  Repeat  Edit                         
  111.  Search method (the function should be in the form of f(X) = 0 )                 
  112.              A           B           C           D           E  
  113.  1 ====================================================================    
  114.  2          Units        |     Output/Input      |        Memory      |    
  115.  3 ====================================================================    
  116.  4   None                |                  0.00 |                0.00|    
  117.  5 ====================================================================    
  118.           EV            EW            EX            EY            EZ            
  119.  1               1             0             1             1 
  120.  2    0.9275510003          0.07             1             1 
  121.  3    0.8502159962          0.14             1             1 
  122.  4    0.7680309147          0.21             1             1 
  123.  5    0.6810554383          0.28             1             1 
  124.  6    0.5893727128          0.35             1             1  
  125.  7    0.4930889403          0.42             1             1 
  126.  8    0.3923328586          0.49             1             1 
  127.  9     0.287255111          0.56             1             1 
  128.  10   0.1780275083          0.63             1             1 
  129.  11   0.0648421873           0.7             1             1 
  130.  12  -0.0520893304          0.77             1             1 
  131.  13  -0.1725371742          0.84             1             1 
  132.  14  -0.2962542505          0.91             1             1 
  133. ____________________________________________________________________________
  134.  
  135.  
  136.  As you can see the function (in column EV) changes its sign from plus 
  137.  to minus between VAR=0.7 and VAR=0.77 which means that the solution to 
  138.  the equation is somewhere between 0.7 and 0.77. To see if there are 
  139.  more roots to the equation use the <V>iew menu item to view the graph 
  140.  and to scroll through the results.
  141.  
  142.  Press <V> to get the next menu:
  143.  
  144.  Down  Up  Next  Previous  Graph  Save_graph                                     
  145.  
  146.  Using the Down, Up, Next and Previous menu items you can scroll 
  147.  through the data table to look for sign changes in the function 
  148.  (column EV). To view the graph press <g>. To get closer to the root 
  149.  let's plot the function between 0.7 and 0.77.
  150.  
  151.  Press <R>epeat and answer the prompts (type the numbers and press 
  152.  ENTER) to get the next screen.
  153.  
  154. ____________________________________________________________________________
  155.  
  156.  Plot_search  Under_relaxation  Newton's  View  Repeat  Edit                         
  157.  Search method (the function should be in the form of f(X) = 0 )                 
  158.              A           B           C           D           E  
  159.  1 ====================================================================    
  160.  2          Units        |     Output/Input      |        Memory      |    
  161.  3 ====================================================================    
  162.  4   None                |                  0.00 |                0.00|    
  163.  5 ====================================================================    
  164.           EV            EW            EX            EY            EZ            
  165.  1    0.0648421873           0.7             1             1 
  166.  2    0.0636910476        0.7007             1             1 
  167.  3    0.0625395333        0.7014             1             1 
  168.  4    0.0613876447        0.7021             1             1 
  169.  5    0.0602353819        0.7028             1             1 
  170.  6    0.0590827453        0.7035             1             1 
  171.  7    0.0579297351        0.7042             1             1 
  172.  8    0.0567763513        0.7049             1             1  
  173.  9    0.0556225944        0.7056             1             1 
  174.  10   0.0544684645        0.7063             1             1
  175.  11   0.0533139617         0.707             1             1  
  176.  12   0.0521590865        0.7077             1             1
  177.  13   0.0510038389        0.7084             1             1
  178.  14   0.0498482192        0.7091             1             1
  179. ____________________________________________________________________________
  180.  
  181.  
  182.  Press <V>iew to see the next menu and the data table:
  183.  
  184. ____________________________________________________________________________
  185.  
  186.  Down  Up  Next  Previous  Graph  Save_graph                                     
  187.  Move one cell down                               [ESC] - Previous menu    
  188.              A           B           C           D           E  
  189.  1 ====================================================================    
  190.  2          Units        |     Output/Input      |        Memory      |    
  191.  3 ====================================================================    
  192.  4   None                |                  0.00 |                0.00|    
  193.  5 ====================================================================    
  194.           EV            EW            EX            EY            EZ            
  195.  49   0.0091688481        0.7336 
  196.  50   0.0079999826        0.7343 
  197.  51   0.0068307534         0.735 
  198.  52   0.0056611607        0.7357  
  199.  53   0.0044912047        0.7364 
  200.  54   0.0033208857        0.7371 
  201.  55   0.0021502038        0.7378 
  202.  56   0.0009791594        0.7385 
  203.  57  -0.0001922473        0.7392  
  204.  58  -0.0013640162        0.7399 
  205.  59  -0.0025361469        0.7406
  206.  60  -0.0037086393        0.7413
  207.  61  -0.0048814931         0.742
  208.  62  -0.0060547081        0.7427
  209. ____________________________________________________________________________
  210.  
  211.  
  212.  Using the Down, Up, Next and Previous menu items you can scroll 
  213.  through the data table to look for the sign changes in the function 
  214.  (column EV). It is clear that the root is between 0.7385 to 0.7392. to 
  215.  find more accurate results we can plot the function again between 
  216.  these two values.
  217.  
  218.  To view the graph press <g>. 
  219.  
  220.  
  221.  <U>nder relaxation
  222.  
  223.  
  224.  This feature uses the Under Relaxation method to solve non-linear
  225.  equations. The equation should be arranged in the form of G(x)=x . 
  226.  The program uses the iteration equation:
  227.  
  228.  X2 = C*G(X1) + (1-C)*X2 
  229.  
  230.  where C is the relaxation factor which affects the convergence rate of 
  231.  the solution. By "playing" with different values of C ( 0<C<1 ) the 
  232.  user can find the best C to converge as fast as possible. 
  233.  
  234.  Let's try to solve the equation    COS(X)-X=0
  235.  
  236.  Press <U> to get the next screen:
  237.  
  238. ____________________________________________________________________________
  239.  
  240.  Plot_search  Under_relaxation  Newton's  View  Repeat  Edit                         
  241.  
  242.  ----------------------------------------------------------------------
  243.              A           B           C           D           E  
  244.  1 ====================================================================    
  245.  2          Units        |     Output/Input      |        Memory      |    
  246.  3 ====================================================================    
  247.  4   None                |                  0.00 |                0.00|    
  248.  5 ====================================================================    
  249.           EV            EW            EX                                        
  250.  1  
  251.  2           
  252.  3  Function -                   @cos(var)
  253.  4 
  254.  5 
  255.  6 
  256.  7 
  257.  8   Input or edit the function as a FORMULA and press ENTER .... 
  258.  9
  259.  10 
  260.  11
  261.  12 
  262.  13
  263.  14
  264. ____________________________________________________________________________
  265.  
  266.  
  267.  The program is now in the Lotus EDIT mode so you can type the function
  268.  as a Lotus formula (no prefix) and press ENTER (press the ENTER key 
  269.  only to quit to the previous menu). Notice that we have used the 
  270.  variable "VAR" as the function variable, you can also use "R" as a 
  271.  variable ( @COS(R) ) but we recommend to use the variable "VAR" unless 
  272.  the function is too long to fit in 240 characters.
  273.  
  274.                                                      
  275.                             **** WARNING ****
  276.  
  277.  Since the program is now in the EDIT mode the Lotus keys are operative, 
  278.  however the user is strongly advised to use ONLY the UP, PGUP, DOWN 
  279.  and PGDN keys to scroll between the lines, the program doesn't allow 
  280.  scrolling to the sides by hiding all the columns except the current
  281.  column. Trying to unhide the columns MAY destroy the program code.
  282.  For example: if by mistake you have pressed the "/" key press ESC to 
  283.  get back to the READY mode and then press F2 to enter EDIT mode or 
  284.  just continue to type or press ENTER key to exit. 
  285.  
  286.  Type the formula [ @cos(var) ] and press ENTER to get the next 
  287.  screen:
  288.  
  289. ____________________________________________________________________________
  290.  
  291.  Accuracy -                                                                      
  292.                                                                                 
  293.              A           B           C           D           E  
  294.  1 ====================================================================    
  295.  2          Units        |     Output/Input      |        Memory      |    
  296.  3 ====================================================================    
  297.  4   None                |                  1.00 |                0.00|    
  298.  5 ====================================================================    
  299.           EV            EW            EX            EY            EZ            
  300.  1               1     
  301.  2                                                                               
  302.  3   Function -                  @COS(EW1)    
  303.  4 
  304.  5     
  305.  6   Accuracy -                         0.0001   
  306.  7    
  307.  8   Initial value -                         2    
  308.  9    
  309.  10  Max. iterations -                     100     
  310.  11    
  311.  12  Number of iterations -                  0    
  312.  13    
  313.  14  Relaxation factor (0<C<1) -            .5    
  314. ____________________________________________________________________________
  315.  
  316.  
  317. Type the accuracy, Initial value, Max. iterations and Relaxation factor
  318. (0<C<1) and press ENTER as the program prompts, the next screen is:
  319.  
  320. ____________________________________________________________________________
  321.  
  322. Plot_search  Under_relaxation  Newton's  View  Repeat                           
  323. Search method (the function should be in the form of f(X) = 0 )                 
  324.              A           B           C           D           E  
  325.  1 ====================================================================    
  326.  2          Units        |     Output/Input      |        Memory      |    
  327.  3 ====================================================================    
  328.  4   None                |          0.7390616306 |                0.00|    
  329.  5 ====================================================================    
  330.           EV            EW            EX            EY            EZ            
  331.  1    0.7390616306   0.739120023                                                 
  332.  2                                                                               
  333.  3   Function -                  @COS(EW1)                                       
  334.  4                                                                               
  335.  5                                                                               
  336.  6   Accuracy -                         0.0001                                   
  337.  7                                                                               
  338.  8   Initial value -                         2                                   
  339.  9                                                                               
  340.  10  Max. iterations                       100                                   
  341.  11                                                                              
  342.  12  Number of iterations -                  6                                   
  343.  13                                                                              
  344.  14  Relaxation factor (0<C<1) -           0.5                                   
  345. ____________________________________________________________________________
  346.  
  347.  
  348.  The program used only six iterations to calculate the root to .0001
  349.  accuracy 0.0001 = last value/previous value ) the last two iterations
  350.  appear in the cells EW1 and EV1. Using other values of C will result 
  351.  in different number of iterations.
  352.  
  353.  
  354.  <N>ewton's
  355.  
  356.  
  357.  This feature uses the Newton's method to solve non-linear equations. 
  358.  The equation should be arranged in the form of G(x)=0. The user also 
  359.  needs to calculate the derivative analytically. The program uses the 
  360.  iteration equation:
  361.  
  362.  X2 = C*G(X1) + (1-C)*X2  (see reference 1 in the README file)
  363.  
  364.  where C is the relaxation factor which affects the convergence rate of 
  365.  the solution. By "playing" with different values of C ( 0<C<1 ) the 
  366.  user can find the best C to converge as fast as possible. 
  367.  
  368.  Let's try to solve the equation    COS(X)-X=0
  369.  
  370.  Press <N> to get the next screen:
  371. ____________________________________________________________________________
  372.                                                                                 
  373.              A           B           C           D           E  
  374.  1 ====================================================================    
  375.  2          Units        |     Output/Input      |        Memory      |    
  376.  3 ====================================================================    
  377.  4   None                |                  0.74 |                0.00|    
  378.  5 ====================================================================    
  379.           EV            EW            EX                                        
  380.  1                                                                               
  381.  2          
  382.  3   Function -           @cos(var)-var                                                       
  383.  4
  384.  5
  385.  6
  386.  7
  387.  8   Input or edit the function as a FORMULA and press ENTER ....                
  388.  9
  389. 10
  390. 11
  391. 12
  392. 13
  393. 14
  394. ____________________________________________________________________________
  395.  
  396.  
  397.  The program is now in the Lotus EDIT mode so you can type the function
  398.  as a Lotus formula (no prefix) and press ENTER (press the ENTER key 
  399.  only to quit to the previous menu). Notice that we have used the 
  400.  variable "VAR" as the function variable, you can also use "R" as a 
  401.  variable ( @COS(R) ) but we recommend to use the variable "VAR" unless 
  402.  the function is too long to fit in 240 characters.
  403.  
  404.                                                      
  405.                            **** WARNING ****
  406.  
  407.  Since the program is in the EDIT mode the Lotus keys are operative, 
  408.  however the user is strongly advised to use ONLY the UP, PGUP, DOWN 
  409.  and PGDN keys to scroll between the lines, the program will not allow 
  410.  scrolling to the sides by hiding all the columns except the current
  411.  columns. Trying to unhide the columns MIGHT destroy the program code.
  412.  For example: if you by mistake pressed the "/" key press ESC to get 
  413.  back to the READY mode and then press F2 to enter EDIT mode or just 
  414.  continue to type or press ENTER to get out. 
  415.  
  416.  Type the formula [ @cos(var) ] and press ENTER to get the next 
  417.  screen:
  418.  
  419.                                                                                 
  420. ____________________________________________________________________________
  421.                                                                                 
  422.              A           B           C           D           E  
  423.  1 ====================================================================    
  424.  2          Units        |     Output/Input      |        Memory      |    
  425.  3 ====================================================================    
  426.  4   None                |                  0.74 |                0.00|    
  427.  5 ====================================================================    
  428.           EV            EW            EX            EY                          
  429.  1               1                                                               
  430.  2                                                                               
  431.  3   Function -                  @COS(EW1)-EW1                                   
  432.  4   Derivative -                -@SIN(EW1)-1                                    
  433.  5                                                                               
  434.  6                                                                               
  435.  7                                                                               
  436.  8   Input or edit the Derivative as a FORMULA and press ENTER ....              
  437.  9                                                                               
  438.  10                                                                              
  439.  11                                                                              
  440.  12                                                                              
  441.  13                                                                              
  442.  14                                                                              
  443. ____________________________________________________________________________
  444.  
  445.  
  446. Again you are in the EDIT mode; type the derivative and press ENTER to 
  447. get the next screen:
  448.  
  449. ____________________________________________________________________________
  450.  
  451.              A           B           C           D           E  
  452.  1 ====================================================================    
  453.  2          Units        |     Output/Input      |        Memory      |    
  454.  3 ====================================================================    
  455.  4   None                |          0.7345361689 |                0.00|    
  456.  5 ====================================================================    
  457.           EV            EW            EX            EY            EZ            
  458.  1    0.7345361689             2                                                 
  459.  2                                                                               
  460.  3   Function -                  @COS(EW1)-EW1                                   
  461.  4   Function derivative -       -@SIN(EW1)-1                                    
  462.  5                                                                               
  463.  6   Accuracy -                         0.0001                                   
  464.  7                                                                               
  465.  8   Initial value -                         2                                   
  466.  9                                                                               
  467.  10  Max. No. of iterations                100                                    
  468.  11                                                                              
  469.  12  Number of iterations -                  0                                   
  470.  13                                                                              
  471.  14  Relaxation factor (0<C<1) -                                                 
  472. _________________________________________________________________________
  473.  
  474.  
  475. To get the next screen type the accuracy, Initial value and Max. iterations 
  476. and press ENTER after each prompt.
  477.  
  478. _________________________________________________________________________
  479.  
  480. Plot_search  Under_relaxation  Newton's  View  Repeat  Edit                     
  481. Search method (the function should be in the form of f(X) = 0 )                 
  482.                A           B           C           D           E           F    
  483. 1   ========================================================================    
  484. 2            Units         |     Output/Input      |        Memory         |    
  485. 3   ========================================================================    
  486. 4   None                   |          0.7390851332 |                     0 |    
  487. 5   ========================================================================    
  488.           EV            EW            EX            EY            EZ            
  489. 1    0.7390851332  0.7390897242                                                 
  490. 2                                                                               
  491. 3   Function -                  @COS(EW1)-EW1                                   
  492. 4   Derivative -                -@SIN(EW1)-1                                    
  493. 5                                                                               
  494. 6   Accuracy -                         0.0001                                   
  495. 7                                                                               
  496. 8   Initial value -                         2                                   
  497. 9                                                                               
  498. 10  Max. iterations                       100                                   
  499. 11                                                                              
  500. 12  Number of iterations -                  3                                   
  501. 13                                                                              
  502. 14                                                                              
  503. _________________________________________________________________________
  504.  
  505.  
  506.  The program used only two iterations to calculate the root to .0001
  507.  (0.0001 = last value/previous value ) the last two iterations appear 
  508.  in the cells EW1 and EV1. 
  509.